package com.mdc.mansion.api.web.common.web;

public class ResponseEntity {
	private String code;
	private String msg;
	private Object data;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	public static ResponseEntity createSuccessResponseEntity(Object data){
		ResponseEntity responseEntity=new ResponseEntity();
		responseEntity.setCode("200");
		responseEntity.setMsg("success");
		responseEntity.setData(data);
		return responseEntity;
	}
	
	public static ResponseEntity createErrorResponseEntity(Object data,String msg){
		ResponseEntity responseEntity=new ResponseEntity();
		responseEntity.setCode("500");
		responseEntity.setMsg(msg);
		responseEntity.setData(data);
		return responseEntity;
	}
}
